//
//  String+extension.swift
//  KySwiftPro
//
//  Created by fangyukui on 2017/10/18.
//  Copyright © 2017年 fangyukui. All rights reserved.
//

import UIKit

extension String{
    subscript (r: Range<Int>) -> String {
        get {
            let startIndex = self.index(self.startIndex, offsetBy: r.lowerBound)
            let endIndex = self.index(self.startIndex, offsetBy: r.upperBound)
            
            return self[startIndex..<endIndex]
        }
    }

}
